home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2081 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.2 KB  |  53 lines

  1. Newsgroups: comp.lang.c++
  2. Path: netcom.com!mictali
  3. From: mictali@netcom.com (Jere McDevitt)
  4. Subject: Re: my problem: class decl. syntax error in turbo c++ 1.0 ???
  5. Message-ID: <mictaliDL8Fyo.A5L@netcom.com>
  6. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  7. X-Newsreader: TIN [version 1.2 PL1]
  8. References: <pooky.23.000EEDAD@euronet.nl>
  9. Date: Mon, 15 Jan 1996 17:16:00 GMT
  10. Sender: mictali@netcom7.netcom.com
  11.  
  12. pooky@euronet.nl wrote:
  13. : I'm using Borland Turbo C++ v1.00 on a 486dx2. Maybe the program is too old?
  14. : Anyway I get the following error:
  15.  
  16. : class time {
  17. : int hr;
  18. : int min;
  19. : int sec;
  20. : };
  21.  
  22. : ... generates a 'declaration syntax error', but
  23.  
  24. : struct time {
  25. : int hr;
  26. : int min;
  27. : int sec;
  28. : };
  29.  
  30. : ... runs correctly.
  31.  
  32. : Does anyone know what could be the problem? Please react!
  33. : I suppose the problem is not in this code. Maybe I should I should 
  34. : include some extra directories in my path?
  35.  
  36. : Thanks for reading,
  37. : Remko.
  38.  
  39. Possibly the problem is that by default, members in a class are private. 
  40. This means that your class definition has no data accessible to the outside
  41. world and no member functions accessible.  Try using a definition like this
  42. and see if it works.
  43.  
  44. class time
  45. {
  46.     public:
  47.         int hr;
  48.         int min;
  49.         int sec;
  50. };
  51.  
  52. Jere
  53.